package com.zhuoyue.elmt;

import java.util.Random;

public class SmsSender {

    /**
     * 随机生成4位字符串
     */
    public static String genRandomStr() {
        String base = "0123456789";
        Random random = new Random();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < 4; i++) {
            int number = random.nextInt(base.length());
            sb.append(base.charAt(number));
        }
        return sb.toString();
    }


    public static void main(String[] args) {
        System.out.println(genRandomStr());
    }
}
